<!doctype html>
<html  class="x-admin-sm">
<head>
    {include file="common/head" /}
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">{:getSystem("ADMIN_NAME")}登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名" value="" type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" value="" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>

    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form;

              form.on('submit(login)', function(data){
                  $.ajax({
                      type: "POST",
                      url: "{:url('rel_login')}",
                      data: data.field,
                      dataType:'json',
                      success: function (result) {
                          if(result.code){
                              layer.msg(result.msg,{icon:6,time:1000},function(){
                                  location.href='{:url("control/Index/index")}'
                              });
                          }else{
                              layer.msg(result.msg,{icon:2,time:1000});
                          }
                      },
                      error: function(data) {
                          layer.msg(data.msg,{icon:2,time:1000});
                      }

                  });
                return false;
              });
            });
        })
    </script>
    <!-- 底部结束 -->

</body>
</html>